package com.hieubq.demo.screenlock.theme.snail.locker;

import android.view.View;
import android.widget.RelativeLayout;

public class LockSlider {
	private float m_x, m_y;
	private float s_x, s_y;
	public View view;

	public float getX() {
		return m_x;
	}

	public float getY() {
		return m_y;
	}

	public float getScaleX()
	{
		return s_x;
	}
	
	public float getScaleY()
	{
		return s_y;
	}
	
	public void setX(float x) {
		this.m_x = x;

		/**
		 * ATTENTION FOR Android less than 3.0 do this. Why Relative? Because
		 * our cointainer in RelativeContainer
		 */
		RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) view
				.getLayoutParams();
		params.leftMargin = (int) x;
		view.setLayoutParams(params);

		/**
		 * IF FOR android 3.0 and more
		 */
		// view.setX(x);

	}

	public void setY(float y) {
		this.m_y = y;

		/**
		 * ATTENTION FOR Android less than 3.0 do this.
		 */
		RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) view
				.getLayoutParams();
		params.topMargin = (int) y;
		view.setLayoutParams(params);

		/**
		 * IF FOR android 3.0 and more
		 */
		// view.setX(x);

	}
}
